#include<bits/stdc++.h>

using namespace std;
using ll = long long;
#define endl '\n'

const int maxn = 10;
int n = 10;
int nums[maxn];
set <vector<int>> sols;

void dfs(int n, int k) {
    if (k >= n) {
        if (accumulate(nums, nums + k, 0) == n) {
            vector<int> s;
            for (int i = 0; i < k; i++) {
                if (nums[i])s.push_back(nums[i]);
            }
            sols.insert(s);
        }

        return;
    }
    for (int i = 0; i <= n; i++) {
        if (i < nums[k - 1])continue;
        nums[k] = i;
        dfs(n - i, k + 1);
    }


}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    dfs(n, 0);
    for (auto sol:sols) {
        copy(sol.begin(), sol.end(), ostream_iterator<int>(cout, " "));
        cout << endl;
    }
    return 0;
}
